sap.ui.define([
    'jquery.sap.global', 'sap/ui/core/mvc/Controller', 'sap/ui/model/json/JSONModel', 'sap/m/MessageToast'
], function(jQuery, Controller, JSONModel, MessageToast) {

    "use strict";

    var creationCtrl = Controller.extend("sap.lx.nba.man.show", {

        onInit: function(event) {

            var model = new JSONModel();

            model.loadData("../get/man");

            this.getView().setModel(model, "man");
            this.model_apps = model;

        },
        getRouter: function() {
            return sap.ui.core.UIComponent.getRouterFor(this);
        },
        onItemPress: function(event) {

            var source = event.getSource();

            var man = source.getBindingContext("man");

            var manId = this.model_apps.getProperty(man + "/id");

            var router = this.getRouter();
            router.navTo("manedit", {

                Id: manId

            }, true);

        },
        onNavButtonPress: function() {

            window.location = "../";

        }

    });

    return creationCtrl;

});
